import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/demand_research/get_personal_result_entity.dart';

GetPersonalResultEntity $GetPersonalResultEntityFromJson(Map<String, dynamic> json) {
  final GetPersonalResultEntity getPersonalResultEntity = GetPersonalResultEntity();
  final int? positionTotalCount = jsonConvert.convert<int>(json['positionTotalCount']);
  if (positionTotalCount != null) {
    getPersonalResultEntity.positionTotalCount = positionTotalCount;
  }
  final int? positionErrorCount = jsonConvert.convert<int>(json['positionErrorCount']);
  if (positionErrorCount != null) {
    getPersonalResultEntity.positionErrorCount = positionErrorCount;
  }
  final int? positionAnswerCount = jsonConvert.convert<int>(json['positionAnswerCount']);
  if (positionAnswerCount != null) {
    getPersonalResultEntity.positionAnswerCount = positionAnswerCount;
  }
  final int? positionUnCount = jsonConvert.convert<int>(json['positionUnCount']);
  if (positionUnCount != null) {
    getPersonalResultEntity.positionUnCount = positionUnCount;
  }
  final String? recommendation = jsonConvert.convert<String>(json['recommendation']);
  if (recommendation != null) {
    getPersonalResultEntity.recommendation = recommendation;
  }
  final List<GetPersonalResultSelectPositionList>? selectPositionList = (json['selectPositionList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<GetPersonalResultSelectPositionList>(e) as GetPersonalResultSelectPositionList).toList();
  if (selectPositionList != null) {
    getPersonalResultEntity.selectPositionList = selectPositionList;
  }
  final List<GetPersonalResultSelectTypeList>? selectTypeList = (json['selectTypeList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<GetPersonalResultSelectTypeList>(e) as GetPersonalResultSelectTypeList).toList();
  if (selectTypeList != null) {
    getPersonalResultEntity.selectTypeList = selectTypeList;
  }
  return getPersonalResultEntity;
}

Map<String, dynamic> $GetPersonalResultEntityToJson(GetPersonalResultEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['positionTotalCount'] = entity.positionTotalCount;
  data['positionErrorCount'] = entity.positionErrorCount;
  data['positionAnswerCount'] = entity.positionAnswerCount;
  data['positionUnCount'] = entity.positionUnCount;
  data['recommendation'] = entity.recommendation;
  data['selectPositionList'] = entity.selectPositionList?.map((v) => v.toJson()).toList();
  data['selectTypeList'] = entity.selectTypeList?.map((v) => v.toJson()).toList();
  return data;
}

extension GetPersonalResultEntityExtension on GetPersonalResultEntity {
  GetPersonalResultEntity copyWith({
    int? positionTotalCount,
    int? positionErrorCount,
    int? positionAnswerCount,
    int? positionUnCount,
    String? recommendation,
    List<GetPersonalResultSelectPositionList>? selectPositionList,
    List<GetPersonalResultSelectTypeList>? selectTypeList,
  }) {
    return GetPersonalResultEntity()
      ..positionTotalCount = positionTotalCount ?? this.positionTotalCount
      ..positionErrorCount = positionErrorCount ?? this.positionErrorCount
      ..positionAnswerCount = positionAnswerCount ?? this.positionAnswerCount
      ..positionUnCount = positionUnCount ?? this.positionUnCount
      ..recommendation = recommendation ?? this.recommendation
      ..selectPositionList = selectPositionList ?? this.selectPositionList
      ..selectTypeList = selectTypeList ?? this.selectTypeList;
  }
}

GetPersonalResultSelectPositionList $GetPersonalResultSelectPositionListFromJson(Map<String, dynamic> json) {
  final GetPersonalResultSelectPositionList getPersonalResultSelectPositionList = GetPersonalResultSelectPositionList();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    getPersonalResultSelectPositionList.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getPersonalResultSelectPositionList.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    getPersonalResultSelectPositionList.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getPersonalResultSelectPositionList.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getPersonalResultSelectPositionList.deleted = deleted;
  }
  final int? duration = jsonConvert.convert<int>(json['duration']);
  if (duration != null) {
    getPersonalResultSelectPositionList.duration = duration;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getPersonalResultSelectPositionList.id = id;
  }
  final String? myValidity = jsonConvert.convert<String>(json['myValidity']);
  if (myValidity != null) {
    getPersonalResultSelectPositionList.myValidity = myValidity;
  }
  final String? optionA = jsonConvert.convert<String>(json['optionA']);
  if (optionA != null) {
    getPersonalResultSelectPositionList.optionA = optionA;
  }
  final String? optionB = jsonConvert.convert<String>(json['optionB']);
  if (optionB != null) {
    getPersonalResultSelectPositionList.optionB = optionB;
  }
  final String? optionC = jsonConvert.convert<String>(json['optionC']);
  if (optionC != null) {
    getPersonalResultSelectPositionList.optionC = optionC;
  }
  final String? optionD = jsonConvert.convert<String>(json['optionD']);
  if (optionD != null) {
    getPersonalResultSelectPositionList.optionD = optionD;
  }
  final String? parsing = jsonConvert.convert<String>(json['parsing']);
  if (parsing != null) {
    getPersonalResultSelectPositionList.parsing = parsing;
  }
  final String? questionMain = jsonConvert.convert<String>(json['questionMain']);
  if (questionMain != null) {
    getPersonalResultSelectPositionList.questionMain = questionMain;
  }
  final String? questionTypeDicId = jsonConvert.convert<String>(json['questionTypeDicId']);
  if (questionTypeDicId != null) {
    getPersonalResultSelectPositionList.questionTypeDicId = questionTypeDicId;
  }
  final String? questionValidity = jsonConvert.convert<String>(json['questionValidity']);
  if (questionValidity != null) {
    getPersonalResultSelectPositionList.questionValidity = questionValidity;
  }
  final int? score = jsonConvert.convert<int>(json['score']);
  if (score != null) {
    getPersonalResultSelectPositionList.score = score;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    getPersonalResultSelectPositionList.textbookId = textbookId;
  }
  final String? timeCount = jsonConvert.convert<String>(json['timeCount']);
  if (timeCount != null) {
    getPersonalResultSelectPositionList.timeCount = timeCount;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getPersonalResultSelectPositionList.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    getPersonalResultSelectPositionList.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getPersonalResultSelectPositionList.updateDate = updateDate;
  }
  return getPersonalResultSelectPositionList;
}

Map<String, dynamic> $GetPersonalResultSelectPositionListToJson(GetPersonalResultSelectPositionList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['duration'] = entity.duration;
  data['id'] = entity.id;
  data['myValidity'] = entity.myValidity;
  data['optionA'] = entity.optionA;
  data['optionB'] = entity.optionB;
  data['optionC'] = entity.optionC;
  data['optionD'] = entity.optionD;
  data['parsing'] = entity.parsing;
  data['questionMain'] = entity.questionMain;
  data['questionTypeDicId'] = entity.questionTypeDicId;
  data['questionValidity'] = entity.questionValidity;
  data['score'] = entity.score;
  data['textbookId'] = entity.textbookId;
  data['timeCount'] = entity.timeCount;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension GetPersonalResultSelectPositionListExtension on GetPersonalResultSelectPositionList {
  GetPersonalResultSelectPositionList copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    int? duration,
    String? id,
    String? myValidity,
    String? optionA,
    String? optionB,
    String? optionC,
    String? optionD,
    String? parsing,
    String? questionMain,
    String? questionTypeDicId,
    String? questionValidity,
    int? score,
    String? textbookId,
    String? timeCount,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return GetPersonalResultSelectPositionList()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..duration = duration ?? this.duration
      ..id = id ?? this.id
      ..myValidity = myValidity ?? this.myValidity
      ..optionA = optionA ?? this.optionA
      ..optionB = optionB ?? this.optionB
      ..optionC = optionC ?? this.optionC
      ..optionD = optionD ?? this.optionD
      ..parsing = parsing ?? this.parsing
      ..questionMain = questionMain ?? this.questionMain
      ..questionTypeDicId = questionTypeDicId ?? this.questionTypeDicId
      ..questionValidity = questionValidity ?? this.questionValidity
      ..score = score ?? this.score
      ..textbookId = textbookId ?? this.textbookId
      ..timeCount = timeCount ?? this.timeCount
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}

GetPersonalResultSelectTypeList $GetPersonalResultSelectTypeListFromJson(Map<String, dynamic> json) {
  final GetPersonalResultSelectTypeList getPersonalResultSelectTypeList = GetPersonalResultSelectTypeList();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getPersonalResultSelectTypeList.id = id;
  }
  final String? dictionaryLabel = jsonConvert.convert<String>(json['dictionaryLabel']);
  if (dictionaryLabel != null) {
    getPersonalResultSelectTypeList.dictionaryLabel = dictionaryLabel;
  }
  final dynamic dictionaryKeyValues = json['dictionaryKeyValues'];
  if (dictionaryKeyValues != null) {
    getPersonalResultSelectTypeList.dictionaryKeyValues = dictionaryKeyValues;
  }
  final dynamic remark = json['remark'];
  if (remark != null) {
    getPersonalResultSelectTypeList.remark = remark;
  }
  final String? dictionaryId = jsonConvert.convert<String>(json['dictionaryId']);
  if (dictionaryId != null) {
    getPersonalResultSelectTypeList.dictionaryId = dictionaryId;
  }
  final int? dictionarySort = jsonConvert.convert<int>(json['dictionarySort']);
  if (dictionarySort != null) {
    getPersonalResultSelectTypeList.dictionarySort = dictionarySort;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getPersonalResultSelectTypeList.createDate = createDate;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getPersonalResultSelectTypeList.createBy = createBy;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getPersonalResultSelectTypeList.updateDate = updateDate;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getPersonalResultSelectTypeList.updateBy = updateBy;
  }
  final String? dictionaryType = jsonConvert.convert<String>(json['dictionaryType']);
  if (dictionaryType != null) {
    getPersonalResultSelectTypeList.dictionaryType = dictionaryType;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    getPersonalResultSelectTypeList.createById = createById;
  }
  final dynamic updateById = json['updateById'];
  if (updateById != null) {
    getPersonalResultSelectTypeList.updateById = updateById;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getPersonalResultSelectTypeList.deleted = deleted;
  }
  final String? pid = jsonConvert.convert<String>(json['pid']);
  if (pid != null) {
    getPersonalResultSelectTypeList.pid = pid;
  }
  return getPersonalResultSelectTypeList;
}

Map<String, dynamic> $GetPersonalResultSelectTypeListToJson(GetPersonalResultSelectTypeList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['dictionaryLabel'] = entity.dictionaryLabel;
  data['dictionaryKeyValues'] = entity.dictionaryKeyValues;
  data['remark'] = entity.remark;
  data['dictionaryId'] = entity.dictionaryId;
  data['dictionarySort'] = entity.dictionarySort;
  data['createDate'] = entity.createDate;
  data['createBy'] = entity.createBy;
  data['updateDate'] = entity.updateDate;
  data['updateBy'] = entity.updateBy;
  data['dictionaryType'] = entity.dictionaryType;
  data['createById'] = entity.createById;
  data['updateById'] = entity.updateById;
  data['deleted'] = entity.deleted;
  data['pid'] = entity.pid;
  return data;
}

extension GetPersonalResultSelectTypeListExtension on GetPersonalResultSelectTypeList {
  GetPersonalResultSelectTypeList copyWith({
    String? id,
    String? dictionaryLabel,
    dynamic dictionaryKeyValues,
    dynamic remark,
    String? dictionaryId,
    int? dictionarySort,
    String? createDate,
    String? createBy,
    String? updateDate,
    String? updateBy,
    String? dictionaryType,
    String? createById,
    dynamic updateById,
    String? deleted,
    String? pid,
  }) {
    return GetPersonalResultSelectTypeList()
      ..id = id ?? this.id
      ..dictionaryLabel = dictionaryLabel ?? this.dictionaryLabel
      ..dictionaryKeyValues = dictionaryKeyValues ?? this.dictionaryKeyValues
      ..remark = remark ?? this.remark
      ..dictionaryId = dictionaryId ?? this.dictionaryId
      ..dictionarySort = dictionarySort ?? this.dictionarySort
      ..createDate = createDate ?? this.createDate
      ..createBy = createBy ?? this.createBy
      ..updateDate = updateDate ?? this.updateDate
      ..updateBy = updateBy ?? this.updateBy
      ..dictionaryType = dictionaryType ?? this.dictionaryType
      ..createById = createById ?? this.createById
      ..updateById = updateById ?? this.updateById
      ..deleted = deleted ?? this.deleted
      ..pid = pid ?? this.pid;
  }
}
